package com.java0.dbshardingsphere02.repository;

import com.java0.dbshardingsphere02.entity.School;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.ResultSetType;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author L.xf
 * @date 2021/10/30
 */
@Mapper
public interface SchoolMapper {

    @Select("SELECT * FROM t_school")
    List<School> findAll();

    @Insert({"insert into t_school(name,create_time) values(#{name}, #{createTime})"})
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int save(School school);
}
